package mess;

public class LeeCode_09 {
    public static void main(String[] args) {
        System.out.println(isPalindrome(121));
    }
    private static boolean isPalindrome(int x) {
        if (x < 0)
            return false;
        int tempX = x;
        int result = 0;
        while (tempX != 0){
            int single = tempX % 10;
            tempX /= 10;
            result = result * 10 + single;
        }
        System.out.println(result);
        return result == x;
    }
}
